/**
 * create by young (young2f@outlook.com) on 2023/4/28
 */
'use strict';
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var req = new XMLHttpRequest();
const tenant = {'tenantCode': 'TEN23042822280074F9',};
req.onreadystatechange = function () {
    console.log(req.status);
    if (req.readyState == 4 && req.status == 200) {
        const devices = JSON.parse(req.responseText);
        console.log(devices.length);
      }
};

req.open('POST', 'http://127.0.0.1:18008/api/device/find/all', true);
req.setRequestHeader('Content-Type', 'application/json;charset=utf-8');
req.send(JSON.stringify(tenant));

